<template>
	<view>
		<cu-custom bgColor="bg-gradual-blue" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">推广中心</block>
		</cu-custom>			
		<my-head :categroy="1" :showid="0" :show="info.is_open_inviter" :expName="info.exp_weixin_name"></my-head>
<!-- 		<view class="equal">
			<view class="equal-settlement">
				<view>待结算(当月)</view>
				<view class="o">{{settlement.total_profiy}}元</view>
			</view>
			<view class="settled">
				<view>待结算(当月)</view>
				<view class="o">{{settlement.total_money}}元</view>				
			</view>
		</view> -->
		<view class="myteam">
			<navigator url="myteam" hover-class="none">
				 <image src="/static/myteam.png" class="img" ></image>
				<view>我的团队({{info.count}})人</view>
			</navigator>
			<navigator url="qrcode" v-if="info.isAgent" hover-class="none">
				<image src="/static/myCode.png" class="img"></image>
				<view>推广二维码</view>
			</navigator>
			<navigator url="profit" hover-class="none">
				<image src="/static/myYield.png" class="img"></image>
				<view>累积收益</view>
			</navigator>
		</view>
	</view>
</template>

<script>
	import MyHead from '@/components/head'
	import { distribution } from '@/common/api/users'
	export default {
		name: 'distribution',
		components: { MyHead },
		data () {
			return {
				info: {},
				settlement:{}	
			}
		},
		onLoad() {
			this.getInfo()
		},
		methods: {
			getInfo () {
				uni.showLoading({ mask: true })
				distribution().then(res => {
					uni.hideLoading()
					this.info = res.data
					if (this.info.is_open_inviter === undefined) this.info.is_open_inviter = 0
					this.settlement = this.info.usermoney
				})
			}
		}
	}
</script>

<style lang="less">
	@import '../common/styles/variables.less';
	.equal{
		margin: 20upx 15upx;
		display:flex;
		justify-content: space-between;
		& > view {
			background: white;
			flex: 1;
			padding: 20upx 0;
			border-radius: 20upx;
			&:first-of-type {margin-right: 20upx}
			& > view {
				text-align: center;
				font-size: @medium;
				&.o {
					font-size: @medium;
					font-weight: 600;
					padding: 10upx 0 0 0;
					color: @red;
				}
			}
		}
	}
	.myteam{
		margin: 20upx 15upx 0;
		display:flex;
		justify-content:space-between;
		& > navigator {
			background-color: white;
			border-radius: 10px;
			margin: 0 20upx 15upx;
			padding: 25upx 15upx;
			display: flex;
			position: relative;
			flex: 1;
			flex-flow: column;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			font-size: 26upx;
			&:nth-of-type(n + 1) {
				margin-left: 0;
			}
			&:last-of-type {
				margin-right: 0
			}
			&>view{
				font-size: @minSize;
				padding-top: 10upx;
			}
			&>.img{
				width: 100upx;
				display: block;
				height: 100upx;
			}
		}
	}
</style>
